@inherits StudioComponentBase
@if (WorkflowDefinition != null && WorkflowInstance != null)
{
    <MudTabs Elevation="0" ApplyEffectsToContainer="true">
        <MudTabPanel Text="Details">
            <Well>
                <div>
                    <MudText Typo="Typo.overline" GutterBottom="true" Align="Align.Left">Workflow</MudText>
                    <DataPanel Data="WorkflowInstanceData" HideEmptyValues="true"/>
                </div>
            </Well>

            @if (WorkflowInstanceSubWorkflowData.Any())
            {
                <Well>
                    <div>
                        <MudText Typo="Typo.overline" GutterBottom="true" Align="Align.Left">Sub-Workflow</MudText>
                        <DataPanel Data="WorkflowInstanceSubWorkflowData" HideEmptyValues="true"/>
                    </div>
                </Well>
            }
        </MudTabPanel>
        <MudTabPanel Text="Variables">
            <VerticalWell ExtraPadding="50">
                <div>
                    @if (WorkflowVariableData.Any())
                    {
                        <DataPanel Data="WorkflowVariableData" HideEmptyValues="false"/>
                    }
                    else
                    {
                        <Well>
                            No variables
                        </Well>
                    }
                </div>
            </VerticalWell>
        </MudTabPanel>
        <MudTabPanel Text="Input/output">
            <Well>
                <div>
                    <MudText Typo="Typo.overline" GutterBottom="true" Align="Align.Left">Inputs</MudText>
                    @if (WorkflowInputData.Any())
                    {
                        <DataPanel Data="WorkflowInputData" HideEmptyValues="false"/>
                    }
                    else
                    {
                        <Well>
                            No inputs
                        </Well>
                    }
                </div>
                <div>
                    <MudText Typo="Typo.overline" GutterBottom="true" Align="Align.Left">Outputs</MudText>
                    @if (WorkflowOutputData.Any())
                    {
                        <DataPanel Data="WorkflowOutputData" HideEmptyValues="false"/>
                    }
                    else
                    {
                        <Well>
                            No outputs
                        </Well>
                    }
                </div>
            </Well>
            <Well>
                @if (SubWorkflowInputData.Any())
                {
                    <div>
                        <MudText Typo="Typo.overline" GutterBottom="true" Align="Align.Left">Sub-Workflow Inputs</MudText>
                        <DataPanel Data="SubWorkflowInputData" HideEmptyValues="false"/>
                    </div>
                }
                @if (SubWorkflowOutputData.Any())
                {
                    <div>
                        <MudText Typo="Typo.overline" GutterBottom="true" Align="Align.Left">Sub-Workflow Outputs</MudText>
                        <DataPanel Data="SubWorkflowOutputData" HideEmptyValues="false"/>
                    </div>
                }
            </Well>
        </MudTabPanel>
    </MudTabs>
}